package com.kgc.cgprovider.controller;

import com.kgc.basic.util.ResponseMsg;
import com.kgc.cgapi.service.PurchaseProviderSummaryRemote;
import com.kgc.cgprovider.service.PurchaseProviderSummaryService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
public class PurchaseProviderSummaryController implements PurchaseProviderSummaryRemote {

    private Logger logger = LoggerFactory.getLogger(PurchaseProviderSummaryController.class);

    @Autowired
    private PurchaseProviderSummaryService purchaseProviderSummaryService;

    @Override
    public ResponseMsg selectSummaryByPurchaseProvider(@RequestBody Map<String, Object> map) {
        logger.info("PurchaseProviderSummaryController selectSummaryByPurchaseProvider map:{}", map);
        ResponseMsg msg = purchaseProviderSummaryService.selectSummaryByPurchaseProvider(map);
        logger.debug("PurchaseProviderSummaryController selectSummaryByPurchaseProvider msg:{}", msg);
        return msg;
    }

    @Override
    public ResponseMsg selectSummaryByStaff(@RequestBody Map<String, Object> map) {
        logger.info("PurchaseProviderSummaryController selectSummaryByStaff map:{}", map);
        ResponseMsg msg = purchaseProviderSummaryService.selectSummaryByStaff(map);
        logger.debug("PurchaseProviderSummaryController selectSummaryByStaff msg:{}", msg);
        return msg;
    }

    @Override
    public ResponseMsg getPurchaseOrderDataByDate() {
        logger.info("PurchaseProviderSummaryController getPurchaseOrderDataByDate is start...");
        ResponseMsg msg = purchaseProviderSummaryService.getPurchaseOrderDataByDate();
        logger.debug("PurchaseProviderSummaryController getPurchaseOrderDataByDate msg:{}",msg);
        return msg;
    }

    @Override
    public ResponseMsg getPurchaseInBoundDataByTime() {
        logger.info("PurchaseProviderSummaryController getPurchaseInBoundDataByTime is start...");
        ResponseMsg msg = purchaseProviderSummaryService.getPurchaseInBoundDataByTime();
        logger.debug("PurchaseProviderSummaryController getPurchaseInBoundDataByTime msg:{}",msg);
        return msg;
    }

    @Override
    public ResponseMsg getPurchaseRequestDataByTime() {
        logger.info("PurchaseProviderSummaryController getPurchaseRequestDataByTime is start...");
        ResponseMsg msg = purchaseProviderSummaryService.getPurchaseRequestDataByTime();
        logger.debug("PurchaseProviderSummaryController getPurchaseRequestDataByTime msg:{}",msg);
        return msg;
    }

    @Override
    public ResponseMsg getPurchaseReturnDataByTime() {
        logger.info("PurchaseProviderSummaryController getPurchaseReturnDataByTime is start...");
        ResponseMsg msg = purchaseProviderSummaryService.getPurchaseReturnDataByTime();
        logger.debug("PurchaseProviderSummaryController getPurchaseReturnDataByTime msg:{}",msg);
        return msg;
    }

}
